package com.yupao.model.enums;

import org.apache.commons.lang3.ObjectUtils;

public enum TeamStatusEnum {


    PUBLIC(0, "公开"),
    PRIVATE(1, "私有"),
    SECRET(2, "加密")
    ;


    public static TeamStatusEnum getStatus(Integer code){
        if (ObjectUtils.isEmpty(code)) {
            return null;
        }

        TeamStatusEnum[] values = TeamStatusEnum.values();
        for (TeamStatusEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }

        return null;
    }

    private Integer code;
    private String msg;

    TeamStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
